package com.kmg.scart.model;

import java.util.HashSet;
import java.util.Set;

public class User extends ApplicationEntity{

	private String userId;
	
	private UserRole userType;
	
	private String email;
	
	private String passwordHash;
	
	private Set<Address> addresses;
	
	private WishList wishlist;
	
	public void addShippingAddress(Address address){
		if(addresses==null){
			addresses = new HashSet<Address>();
		}
		address.setAddressType(AddressType.SHIPPING);
		addresses.add(address);
	}
	
	public void addBillingAddress(Address address){
		if(addresses==null){
			addresses = new HashSet<Address>();
		}
		address.setAddressType(AddressType.BILLING);
		addresses.add(address);
	}
	
	public void addAddress(Address address){
		if(addresses==null){
			addresses = new HashSet<Address>();
		}
		address.setAddressType(AddressType.COMMON);
		addresses.add(address);
	}
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}



	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public UserRole getUserType() {
		return userType;
	}

	public void setUserType(UserRole userType) {
		this.userType = userType;
	}

	public Set<Address> getAddresses() {
		return addresses;
	}

	public void setAddresses(Set<Address> addresses) {
		this.addresses = addresses;
	}

	public String getPasswordHash() {
		return passwordHash;
	}

	public void setPasswordHash(String passwordHash) {
		this.passwordHash = passwordHash;
	}

	public WishList getWishlist() {
		return wishlist;
	}

	public void setWishlist(WishList wishlist) {
		this.wishlist = wishlist;
	}
}
